package com.huolian.calculator.service;

public class CalculatorService {
    //计算器功能
    public int addSimpleFunction(int a,int b){
        return a + b;
    }

    public int subtractSimpleFunction(int a, int b){
        return a - b;
    }

    public int multiplySimpleFunction(int a, int b){
        return a * b;
    }

    public int divideSimpleFunction(int a, int b){
       //被除数不能为0，使用if语句判断
        if(b == 0){
            System.out.println("被除数不能为0");
            return 0;
        }
        return a / b;
    }
}
